<!-- Shortened version of: https://requests.readthedocs.io/en/latest/api/ -->
<!-- 2023-04-10 Maintained to detect potential regressions, but feel free to remove -->
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Developer Interface &#8212; Requests 2.28.2 documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/alabaster.css" />
    <link rel="stylesheet" type="text/css" href="/_/static/css/badge_only.css" />
    <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script async="async" src="/_/static/javascript/readthedocs-doc-embed.js"></script>
    <link rel="canonical" href="https://requests.readthedocs.io/en/latest/api.html" />
    <link rel="index" title="Index" href="../genindex/" />
    <link rel="search" title="Search" href="../search/" />
    <link rel="next" title="Contributor’s Guide" href="../dev/contributing/" />
    <link rel="prev" title="Community Updates" href="../community/updates/" />

  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />


  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />


<!-- RTD Extra Head -->

<link rel="stylesheet" href="/_/static/css/readthedocs-doc-embed.css" type="text/css" />

<script type="application/json" id="READTHEDOCS_DATA">{"ad_free": false, "api_host": "https://readthedocs.org", "build_date": "2023-03-03T20:39:35Z", "builder": "sphinx", "canonical_url": null, "commit": "7f694b79", "docroot": "/docs/", "features": {"docsearch_disabled": false}, "global_analytics_code": "UA-17997319-1", "language": "en", "page": "api", "programming_language": "py", "project": "requests", "proxied_api_host": "/_", "source_suffix": ".rst", "subprojects": {"requests-docs-cn": "https://requests.readthedocs.io/projects/cn/zh_CN/latest/", "requests-docs-de": "https://requests.readthedocs.io/projects/de/de/latest/", "requests-docs-es": "https://requests.readthedocs.io/projects/es/es/latest/", "requests-docs-it": "https://requests.readthedocs.io/projects/it/it/latest/", "requests-docs-pl": "https://requests.readthedocs.io/projects/pl/pl/latest/", "requests-docs-pt": "https://requests.readthedocs.io/projects/pt/pt_BR/latest/", "requests-html": "https://requests.readthedocs.io/projects/requests-html/en/latest/"}, "theme": "alabaster", "user_analytics_code": "", "version": "latest"}</script>

<!--
Using this variable directly instead of using `JSON.parse` is deprecated.
The READTHEDOCS_DATA global variable will be removed in the future.
-->
<script type="text/javascript">
READTHEDOCS_DATA = JSON.parse(document.getElementById('READTHEDOCS_DATA').innerHTML);
</script>

<script type="text/javascript" src="/_/static/javascript/readthedocs-analytics.js" async="async"></script>

<!-- end RTD <extrahead> -->
</head><body>


    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">


          <div class="body" role="main">

  <section id="module-requests">
<span id="developer-interface"></span><span id="api"></span><h1>Developer Interface<a class="headerlink" href="#module-requests" title="Permalink to this headline">¶</a></h1>
<p>This part of the documentation covers all the interfaces of Requests. For
parts where Requests depends on external libraries, we document the most
important right here and provide links to the canonical documentation.</p>
<section id="main-interface">
<h2>Main Interface<a class="headerlink" href="#main-interface" title="Permalink to this headline">¶</a></h2>
<p>All of Requests’ functionality can be accessed by these 7 methods.
They all return an instance of the <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="py function">
<dt class="sig sig-object py" id="requests.request">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/api/#request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.request" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs and sends a <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>method</strong> – method for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object: <code class="docutils literal notranslate"><span class="pre">GET</span></code>, <code class="docutils literal notranslate"><span class="pre">OPTIONS</span></code>, <code class="docutils literal notranslate"><span class="pre">HEAD</span></code>, <code class="docutils literal notranslate"><span class="pre">POST</span></code>, <code class="docutils literal notranslate"><span class="pre">PUT</span></code>, <code class="docutils literal notranslate"><span class="pre">PATCH</span></code>, or <code class="docutils literal notranslate"><span class="pre">DELETE</span></code>.</p></li>
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>params</strong> – (optional) Dictionary, list of tuples or bytes to send
in the query string for the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>json</strong> – (optional) A JSON serializable Python object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>headers</strong> – (optional) Dictionary of HTTP Headers to send with the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>cookies</strong> – (optional) Dict or CookieJar object to send with the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>files</strong> – (optional) Dictionary of <code class="docutils literal notranslate"><span class="pre">'name':</span> <span class="pre">file-like-objects</span></code> (or <code class="docutils literal notranslate"><span class="pre">{'name':</span> <span class="pre">file-tuple}</span></code>) for multipart encoding upload.
<code class="docutils literal notranslate"><span class="pre">file-tuple</span></code> can be a 2-tuple <code class="docutils literal notranslate"><span class="pre">('filename',</span> <span class="pre">fileobj)</span></code>, 3-tuple <code class="docutils literal notranslate"><span class="pre">('filename',</span> <span class="pre">fileobj,</span> <span class="pre">'content_type')</span></code>
or a 4-tuple <code class="docutils literal notranslate"><span class="pre">('filename',</span> <span class="pre">fileobj,</span> <span class="pre">'content_type',</span> <span class="pre">custom_headers)</span></code>, where <code class="docutils literal notranslate"><span class="pre">'content-type'</span></code> is a string
defining the content type of the given file and <code class="docutils literal notranslate"><span class="pre">custom_headers</span></code> a dict-like object containing additional headers
to add for the file.</p></li>
<li><p><strong>auth</strong> – (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.</p></li>
<li><p><strong>timeout</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.11)"><em>float</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.11)"><em>tuple</em></a>) – (optional) How many seconds to wait for the server to send data
before giving up, as a float, or a <a class="reference internal" href="../user/advanced/#timeouts"><span class="std std-ref">(connect timeout, read
timeout)</span></a> tuple.</p></li>
<li><p><strong>allow_redirects</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><em>bool</em></a>) – (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li>
<li><p><strong>proxies</strong> – (optional) Dictionary mapping protocol to the URL of the proxy.</p></li>
<li><p><strong>verify</strong> – (optional) Either a boolean, in which case it controls whether we verify
the server’s TLS certificate, or a string, in which case it must be a path
to a CA bundle to use. Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li>
<li><p><strong>stream</strong> – (optional) if <code class="docutils literal notranslate"><span class="pre">False</span></code>, the response content will be immediately downloaded.</p></li>
<li><p><strong>cert</strong> – (optional) if String, path to ssl client cert file (.pem). If Tuple, (‘cert’, ‘key’) pair.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
<p>Usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">requests</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">req</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;https://httpbin.org/get&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">req</span>
<span class="go">&lt;Response [200]&gt;</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.head">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">head</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/api/#head"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.head" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a HEAD request.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes. If
<cite>allow_redirects</cite> is not provided, it will be set to <cite>False</cite> (as
opposed to the default <a class="reference internal" href="#requests.request" title="requests.request"><code class="xref py py-meth docutils literal notranslate"><span class="pre">request</span></code></a> behavior).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.get">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/api/#get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a GET request.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>params</strong> – (optional) Dictionary, list of tuples or bytes to send
in the query string for the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.post">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">post</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">json</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/api/#post"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.post" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a POST request.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>json</strong> – (optional) A JSON serializable Python object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.put">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">put</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/api/#put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a PUT request.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>json</strong> – (optional) A JSON serializable Python object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.patch">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">patch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/api/#patch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.patch" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a PATCH request.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>json</strong> – (optional) A JSON serializable Python object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.delete">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">delete</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/api/#delete"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a DELETE request.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="exceptions">
<h2>Exceptions<a class="headerlink" href="#exceptions" title="Permalink to this headline">¶</a></h2>
<dl class="py exception">
<dt class="sig sig-object py" id="requests.RequestException">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">RequestException</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#RequestException"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.RequestException" title="Permalink to this definition">¶</a></dt>
<dd><p>There was an ambiguous exception that occurred while handling your
request.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.ConnectionError">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">ConnectionError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#ConnectionError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.ConnectionError" title="Permalink to this definition">¶</a></dt>
<dd><p>A Connection error occurred.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.HTTPError">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">HTTPError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#HTTPError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.HTTPError" title="Permalink to this definition">¶</a></dt>
<dd><p>An HTTP error occurred.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.URLRequired">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">URLRequired</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#URLRequired"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.URLRequired" title="Permalink to this definition">¶</a></dt>
<dd><p>A valid URL is required to make a request.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.TooManyRedirects">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">TooManyRedirects</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#TooManyRedirects"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.TooManyRedirects" title="Permalink to this definition">¶</a></dt>
<dd><p>Too many redirects.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.ConnectTimeout">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">ConnectTimeout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#ConnectTimeout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.ConnectTimeout" title="Permalink to this definition">¶</a></dt>
<dd><p>The request timed out while trying to connect to the remote server.</p>
<p>Requests that produced this error are safe to retry.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.ReadTimeout">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">ReadTimeout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#ReadTimeout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.ReadTimeout" title="Permalink to this definition">¶</a></dt>
<dd><p>The server did not send any data in the allotted amount of time.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.Timeout">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">Timeout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#Timeout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>The request timed out.</p>
<p>Catching this error will catch both
<a class="reference internal" href="#requests.ConnectTimeout" title="requests.exceptions.ConnectTimeout"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ConnectTimeout</span></code></a> and
<a class="reference internal" href="#requests.ReadTimeout" title="requests.exceptions.ReadTimeout"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ReadTimeout</span></code></a> errors.</p>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="requests.JSONDecodeError">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">JSONDecodeError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/exceptions/#JSONDecodeError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.JSONDecodeError" title="Permalink to this definition">¶</a></dt>
<dd><p>Couldn’t decode the text into json</p>
</dd></dl>

</section>
<section id="request-sessions">
<h2>Request Sessions<a class="headerlink" href="#request-sessions" title="Permalink to this headline">¶</a></h2>
<span class="target" id="sessionapi"></span><dl class="py class">
<dt class="sig sig-object py" id="requests.Session">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">Session</span></span><a class="reference internal" href="../_modules/requests/sessions/#Session"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session" title="Permalink to this definition">¶</a></dt>
<dd><p>A Requests session.</p>
<p>Provides cookie persistence, connection-pooling, and configuration.</p>
<p>Basic Usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">requests</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">Session</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;https://httpbin.org/get&#39;</span><span class="p">)</span>
<span class="go">&lt;Response [200]&gt;</span>
</pre></div>
</div>
<p>Or as a context manager:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="k">with</span> <span class="n">requests</span><span class="o">.</span><span class="n">Session</span><span class="p">()</span> <span class="k">as</span> <span class="n">s</span><span class="p">:</span>
<span class="gp">... </span>    <span class="n">s</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;https://httpbin.org/get&#39;</span><span class="p">)</span>
<span class="go">&lt;Response [200]&gt;</span>
</pre></div>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.auth">
<span class="sig-name descname"><span class="pre">auth</span></span><a class="headerlink" href="#requests.Session.auth" title="Permalink to this definition">¶</a></dt>
<dd><p>Default Authentication tuple or object to attach to
<a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.cert">
<span class="sig-name descname"><span class="pre">cert</span></span><a class="headerlink" href="#requests.Session.cert" title="Permalink to this definition">¶</a></dt>
<dd><p>SSL client certificate default, if String, path to ssl client
cert file (.pem). If Tuple, (‘cert’, ‘key’) pair.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.close">
<span class="sig-name descname"><span class="pre">close</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes all adapters and as such the session</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.cookies">
<span class="sig-name descname"><span class="pre">cookies</span></span><a class="headerlink" href="#requests.Session.cookies" title="Permalink to this definition">¶</a></dt>
<dd><p>A CookieJar containing all currently outstanding cookies set on this
session. By default it is a
<a class="reference internal" href="#requests.cookies.RequestsCookieJar" title="requests.cookies.RequestsCookieJar"><code class="xref py py-class docutils literal notranslate"><span class="pre">RequestsCookieJar</span></code></a>, but
may be any other <code class="docutils literal notranslate"><span class="pre">cookielib.CookieJar</span></code> compatible object.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.delete">
<span class="sig-name descname"><span class="pre">delete</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.delete"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a DELETE request. Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.get">
<span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a GET request. Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.get_adapter">
<span class="sig-name descname"><span class="pre">get_adapter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.get_adapter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.get_adapter" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the appropriate connection adapter for the given URL.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.adapters.BaseAdapter" title="requests.adapters.BaseAdapter">requests.adapters.BaseAdapter</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.get_redirect_target">
<span class="sig-name descname"><span class="pre">get_redirect_target</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Session.get_redirect_target" title="Permalink to this definition">¶</a></dt>
<dd><p>Receives a Response. Returns a redirect URI or <code class="docutils literal notranslate"><span class="pre">None</span></code></p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.head">
<span class="sig-name descname"><span class="pre">head</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.head"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.head" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a HEAD request. Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.headers">
<span class="sig-name descname"><span class="pre">headers</span></span><a class="headerlink" href="#requests.Session.headers" title="Permalink to this definition">¶</a></dt>
<dd><p>A case-insensitive dictionary of headers to be sent on each
<a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> sent from this
<a class="reference internal" href="#requests.Session" title="requests.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a>.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.hooks">
<span class="sig-name descname"><span class="pre">hooks</span></span><a class="headerlink" href="#requests.Session.hooks" title="Permalink to this definition">¶</a></dt>
<dd><p>Event-handling hooks.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.max_redirects">
<span class="sig-name descname"><span class="pre">max_redirects</span></span><a class="headerlink" href="#requests.Session.max_redirects" title="Permalink to this definition">¶</a></dt>
<dd><p>Maximum number of redirects allowed. If the request exceeds this
limit, a <a class="reference internal" href="#requests.TooManyRedirects" title="requests.TooManyRedirects"><code class="xref py py-class docutils literal notranslate"><span class="pre">TooManyRedirects</span></code></a> exception is raised.
This defaults to requests.models.DEFAULT_REDIRECT_LIMIT, which is
30.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.merge_environment_settings">
<span class="sig-name descname"><span class="pre">merge_environment_settings</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stream</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.merge_environment_settings"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.merge_environment_settings" title="Permalink to this definition">¶</a></dt>
<dd><p>Check the environment and merge it with some settings.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)">dict</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.mount">
<span class="sig-name descname"><span class="pre">mount</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prefix</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">adapter</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.mount"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.mount" title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a connection adapter to a prefix.</p>
<p>Adapters are sorted in descending order by prefix length.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.options">
<span class="sig-name descname"><span class="pre">options</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.options"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.options" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a OPTIONS request. Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.params">
<span class="sig-name descname"><span class="pre">params</span></span><a class="headerlink" href="#requests.Session.params" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary of querystring data to attach to each
<a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>. The dictionary values may be lists for
representing multivalued query parameters.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.patch">
<span class="sig-name descname"><span class="pre">patch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.patch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.patch" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a PATCH request. Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.post">
<span class="sig-name descname"><span class="pre">post</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">json</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.post"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.post" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a POST request. Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>json</strong> – (optional) json to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.prepare_request">
<span class="sig-name descname"><span class="pre">prepare_request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.prepare_request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.prepare_request" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs a <a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest"><code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code></a> for
transmission and returns it. The <a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest"><code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code></a> has settings
merged from the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> instance and those of the
<a class="reference internal" href="#requests.Session" title="requests.Session"><code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>request</strong> – <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> instance to prepare with this
session’s settings.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest">requests.PreparedRequest</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.proxies">
<span class="sig-name descname"><span class="pre">proxies</span></span><a class="headerlink" href="#requests.Session.proxies" title="Permalink to this definition">¶</a></dt>
<dd><p>Dictionary mapping protocol or protocol and host to the URL of the proxy
(e.g. {‘http’: ‘foo.bar:3128’, ‘http://host.name’: ‘foo.bar:4012’}) to
be used on each <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.put">
<span class="sig-name descname"><span class="pre">put</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a PUT request. Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.rebuild_auth">
<span class="sig-name descname"><span class="pre">rebuild_auth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prepared_request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">response</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Session.rebuild_auth" title="Permalink to this definition">¶</a></dt>
<dd><p>When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.rebuild_method">
<span class="sig-name descname"><span class="pre">rebuild_method</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prepared_request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">response</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Session.rebuild_method" title="Permalink to this definition">¶</a></dt>
<dd><p>When being redirected we may want to change the method of the request
based on certain specs or browser behavior.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.rebuild_proxies">
<span class="sig-name descname"><span class="pre">rebuild_proxies</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prepared_request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Session.rebuild_proxies" title="Permalink to this definition">¶</a></dt>
<dd><p>This method re-evaluates the proxy configuration by considering the
environment variables. If we are redirected to a URL covered by
NO_PROXY, we strip the proxy configuration. Otherwise, we set missing
proxy keys for this URL (in case they were stripped by a previous
redirect).</p>
<p>This method also replaces the Proxy-Authorization header where
necessary.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)">dict</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.request">
<span class="sig-name descname"><span class="pre">request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">headers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cookies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">files</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auth</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allow_redirects</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hooks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stream</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">json</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.request" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs a <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>, prepares it and sends it.
Returns <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>method</strong> – method for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>url</strong> – URL for the new <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p></li>
<li><p><strong>params</strong> – (optional) Dictionary or bytes to be sent in the query
string for the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>json</strong> – (optional) json to send in the body of the
<a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>headers</strong> – (optional) Dictionary of HTTP Headers to send with the
<a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>cookies</strong> – (optional) Dict or CookieJar object to send with the
<a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a>.</p></li>
<li><p><strong>files</strong> – (optional) Dictionary of <code class="docutils literal notranslate"><span class="pre">'filename':</span> <span class="pre">file-like-objects</span></code>
for multipart encoding upload.</p></li>
<li><p><strong>auth</strong> – (optional) Auth tuple or callable to enable
Basic/Digest/Custom HTTP Auth.</p></li>
<li><p><strong>timeout</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.11)"><em>float</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.11)"><em>tuple</em></a>) – (optional) How long to wait for the server to send
data before giving up, as a float, or a <a class="reference internal" href="../user/advanced/#timeouts"><span class="std std-ref">(connect timeout,
read timeout)</span></a> tuple.</p></li>
<li><p><strong>allow_redirects</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)"><em>bool</em></a>) – (optional) Set to True by default.</p></li>
<li><p><strong>proxies</strong> – (optional) Dictionary mapping protocol or protocol and
hostname to the URL of the proxy.</p></li>
<li><p><strong>stream</strong> – (optional) whether to immediately download the response
content. Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li>
<li><p><strong>verify</strong> – (optional) Either a boolean, in which case it controls whether we verify
the server’s TLS certificate, or a string, in which case it must be a path
to a CA bundle to use. Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>. When set to
<code class="docutils literal notranslate"><span class="pre">False</span></code>, requests will accept any TLS certificate presented by
the server, and will ignore hostname mismatches and/or expired
certificates, which will make your application vulnerable to
man-in-the-middle (MitM) attacks. Setting verify to <code class="docutils literal notranslate"><span class="pre">False</span></code>
may be useful during local development or testing.</p></li>
<li><p><strong>cert</strong> – (optional) if String, path to ssl client cert file (.pem).
If Tuple, (‘cert’, ‘key’) pair.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.resolve_redirects">
<span class="sig-name descname"><span class="pre">resolve_redirects</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">resp</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">req</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stream</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yield_requests</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">adapter_kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Session.resolve_redirects" title="Permalink to this definition">¶</a></dt>
<dd><p>Receives a Response. Returns a generator of Responses or Requests.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.send">
<span class="sig-name descname"><span class="pre">send</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/sessions/#Session.send"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Session.send" title="Permalink to this definition">¶</a></dt>
<dd><p>Send a given PreparedRequest.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Session.should_strip_auth">
<span class="sig-name descname"><span class="pre">should_strip_auth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">old_url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">new_url</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Session.should_strip_auth" title="Permalink to this definition">¶</a></dt>
<dd><p>Decide whether Authorization header should be removed when redirecting</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.stream">
<span class="sig-name descname"><span class="pre">stream</span></span><a class="headerlink" href="#requests.Session.stream" title="Permalink to this definition">¶</a></dt>
<dd><p>Stream response content default.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.trust_env">
<span class="sig-name descname"><span class="pre">trust_env</span></span><a class="headerlink" href="#requests.Session.trust_env" title="Permalink to this definition">¶</a></dt>
<dd><p>Trust environment settings for proxy configuration, default
authentication and similar.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Session.verify">
<span class="sig-name descname"><span class="pre">verify</span></span><a class="headerlink" href="#requests.Session.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>SSL Verification default.
Defaults to <cite>True</cite>, requiring requests to verify the TLS certificate at the
remote end.
If verify is set to <cite>False</cite>, requests will accept any TLS certificate
presented by the server, and will ignore hostname mismatches and/or
expired certificates, which will make your application vulnerable to
man-in-the-middle (MitM) attacks.
Only set this to <cite>False</cite> for testing.</p>
</dd></dl>

</dd></dl>

</section>
<section id="lower-level-classes">
<h2>Lower-Level Classes<a class="headerlink" href="#lower-level-classes" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="requests.Request">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">Request</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">headers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">files</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auth</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cookies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hooks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">json</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#Request"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Request" title="Permalink to this definition">¶</a></dt>
<dd><p>A user-created <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object.</p>
<p>Used to prepare a <a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest"><code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code></a>, which is sent to the server.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>method</strong> – HTTP method to use.</p></li>
<li><p><strong>url</strong> – URL to send.</p></li>
<li><p><strong>headers</strong> – dictionary of headers to send.</p></li>
<li><p><strong>files</strong> – dictionary of {filename: fileobject} files to multipart upload.</p></li>
<li><p><strong>data</strong> – the body to attach to the request. If a dictionary or
list of tuples <code class="docutils literal notranslate"><span class="pre">[(key,</span> <span class="pre">value)]</span></code> is provided, form-encoding will
take place.</p></li>
<li><p><strong>json</strong> – json for the body to attach to the request (if files or data is not specified).</p></li>
<li><p><strong>params</strong> – URL parameters to append to the URL. If a dictionary or
list of tuples <code class="docutils literal notranslate"><span class="pre">[(key,</span> <span class="pre">value)]</span></code> is provided, form-encoding will
take place.</p></li>
<li><p><strong>auth</strong> – Auth handler or (user, pass) tuple.</p></li>
<li><p><strong>cookies</strong> – dictionary or CookieJar of cookies to attach to this request.</p></li>
<li><p><strong>hooks</strong> – dictionary of callback hooks, for internal usage.</p></li>
</ul>
</dd>
</dl>
<p>Usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">requests</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">req</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;https://httpbin.org/get&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">req</span><span class="o">.</span><span class="n">prepare</span><span class="p">()</span>
<span class="go">&lt;PreparedRequest [GET]&gt;</span>
</pre></div>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="requests.Request.deregister_hook">
<span class="sig-name descname"><span class="pre">deregister_hook</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">event</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hook</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Request.deregister_hook" title="Permalink to this definition">¶</a></dt>
<dd><p>Deregister a previously registered hook.
Returns True if the hook existed, False if not.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Request.prepare">
<span class="sig-name descname"><span class="pre">prepare</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#Request.prepare"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Request.prepare" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs a <a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest"><code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code></a> for transmission and returns it.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Request.register_hook">
<span class="sig-name descname"><span class="pre">register_hook</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">event</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hook</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.Request.register_hook" title="Permalink to this definition">¶</a></dt>
<dd><p>Properly register a hook.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.Response">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">Response</span></span><a class="reference internal" href="../_modules/requests/models/#Response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Response" title="Permalink to this definition">¶</a></dt>
<dd><p>The <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object, which contains a
server’s response to an HTTP request.</p>
<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.apparent_encoding">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">apparent_encoding</span></span><a class="headerlink" href="#requests.Response.apparent_encoding" title="Permalink to this definition">¶</a></dt>
<dd><p>The apparent encoding, provided by the charset_normalizer or chardet libraries.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Response.close">
<span class="sig-name descname"><span class="pre">close</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#Response.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Response.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Releases the connection back to the pool. Once this method has been
called the underlying <code class="docutils literal notranslate"><span class="pre">raw</span></code> object must not be accessed again.</p>
<p><em>Note: Should not normally need to be called explicitly.</em></p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.content">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">content</span></span><a class="headerlink" href="#requests.Response.content" title="Permalink to this definition">¶</a></dt>
<dd><p>Content of the response, in bytes.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.cookies">
<span class="sig-name descname"><span class="pre">cookies</span></span><a class="headerlink" href="#requests.Response.cookies" title="Permalink to this definition">¶</a></dt>
<dd><p>A CookieJar of Cookies the server sent back.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.elapsed">
<span class="sig-name descname"><span class="pre">elapsed</span></span><a class="headerlink" href="#requests.Response.elapsed" title="Permalink to this definition">¶</a></dt>
<dd><p>The amount of time elapsed between sending the request
and the arrival of the response (as a timedelta).
This property specifically measures the time taken between sending
the first byte of the request and finishing parsing the headers. It
is therefore unaffected by consuming the response content or the
value of the <code class="docutils literal notranslate"><span class="pre">stream</span></code> keyword argument.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.encoding">
<span class="sig-name descname"><span class="pre">encoding</span></span><a class="headerlink" href="#requests.Response.encoding" title="Permalink to this definition">¶</a></dt>
<dd><p>Encoding to decode with when accessing r.text.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.headers">
<span class="sig-name descname"><span class="pre">headers</span></span><a class="headerlink" href="#requests.Response.headers" title="Permalink to this definition">¶</a></dt>
<dd><p>Case-insensitive Dictionary of Response Headers.
For example, <code class="docutils literal notranslate"><span class="pre">headers['content-encoding']</span></code> will return the
value of a <code class="docutils literal notranslate"><span class="pre">'Content-Encoding'</span></code> response header.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.history">
<span class="sig-name descname"><span class="pre">history</span></span><a class="headerlink" href="#requests.Response.history" title="Permalink to this definition">¶</a></dt>
<dd><p>A list of <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> objects from
the history of the Request. Any redirect responses will end
up here. The list is sorted from the oldest to the most recent request.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.is_permanent_redirect">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_permanent_redirect</span></span><a class="headerlink" href="#requests.Response.is_permanent_redirect" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this Response one of the permanent versions of redirect.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.is_redirect">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_redirect</span></span><a class="headerlink" href="#requests.Response.is_redirect" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this Response is a well-formed HTTP redirect that could have
been processed automatically (by <a class="reference internal" href="#requests.Session.resolve_redirects" title="requests.Session.resolve_redirects"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Session.resolve_redirects</span></code></a>).</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Response.iter_content">
<span class="sig-name descname"><span class="pre">iter_content</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chunk_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">decode_unicode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#Response.iter_content"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Response.iter_content" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates over the response data.  When stream=True is set on the
request, this avoids reading the content at once into memory for
large responses.  The chunk size is the number of bytes it should
read into memory.  This is not necessarily the length of each item
returned as decoding can take place.</p>
<p>chunk_size must be of type int or None. A value of None will
function differently depending on the value of <cite>stream</cite>.
stream=True will read data as it arrives in whatever size the
chunks are received. If stream=False, data is returned as
a single chunk.</p>
<p>If decode_unicode is True, content will be decoded using the best
available encoding based on the response.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Response.iter_lines">
<span class="sig-name descname"><span class="pre">iter_lines</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chunk_size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">512</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">decode_unicode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delimiter</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#Response.iter_lines"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Response.iter_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates over the response data, one line at a time.  When
stream=True is set on the request, this avoids reading the
content at once into memory for large responses.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This method is not reentrant safe.</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Response.json">
<span class="sig-name descname"><span class="pre">json</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#Response.json"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Response.json" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the json-encoded content of a response, if any.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">json.loads</span></code> takes.</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.JSONDecodeError" title="requests.exceptions.JSONDecodeError"><strong>requests.exceptions.JSONDecodeError</strong></a> – If the response body does not
contain valid json.</p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.links">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">links</span></span><a class="headerlink" href="#requests.Response.links" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the parsed header links of the response, if any.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.next">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">next</span></span><a class="headerlink" href="#requests.Response.next" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a PreparedRequest for the next request in a redirect chain, if there is one.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.ok">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">ok</span></span><a class="headerlink" href="#requests.Response.ok" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <a class="reference internal" href="#requests.Response.status_code" title="requests.Response.status_code"><code class="xref py py-attr docutils literal notranslate"><span class="pre">status_code</span></code></a> is less than 400, False if not.</p>
<p>This attribute checks if the status code of the response is between
400 and 600 to see if there was a client error or a server error. If
the status code is between 200 and 400, this will return True. This
is <strong>not</strong> a check to see if the response code is <code class="docutils literal notranslate"><span class="pre">200</span> <span class="pre">OK</span></code>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.Response.raise_for_status">
<span class="sig-name descname"><span class="pre">raise_for_status</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#Response.raise_for_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.Response.raise_for_status" title="Permalink to this definition">¶</a></dt>
<dd><p>Raises <a class="reference internal" href="#requests.HTTPError" title="requests.HTTPError"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPError</span></code></a>, if one occurred.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.raw">
<span class="sig-name descname"><span class="pre">raw</span></span><a class="headerlink" href="#requests.Response.raw" title="Permalink to this definition">¶</a></dt>
<dd><p>File-like object representation of response (for advanced usage).
Use of <code class="docutils literal notranslate"><span class="pre">raw</span></code> requires that <code class="docutils literal notranslate"><span class="pre">stream=True</span></code> be set on the request.
This requirement does not apply for use internally to Requests.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.reason">
<span class="sig-name descname"><span class="pre">reason</span></span><a class="headerlink" href="#requests.Response.reason" title="Permalink to this definition">¶</a></dt>
<dd><p>Textual reason of responded HTTP Status, e.g. “Not Found” or “OK”.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.request">
<span class="sig-name descname"><span class="pre">request</span></span><a class="headerlink" href="#requests.Response.request" title="Permalink to this definition">¶</a></dt>
<dd><p>The <a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest"><code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code></a> object to which this
is a response.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.status_code">
<span class="sig-name descname"><span class="pre">status_code</span></span><a class="headerlink" href="#requests.Response.status_code" title="Permalink to this definition">¶</a></dt>
<dd><p>Integer Code of responded HTTP Status, e.g. 404 or 200.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.Response.text">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">text</span></span><a class="headerlink" href="#requests.Response.text" title="Permalink to this definition">¶</a></dt>
<dd><p>Content of the response, in unicode.</p>
<p>If Response.encoding is None, encoding will be guessed using
<code class="docutils literal notranslate"><span class="pre">charset_normalizer</span></code> or <code class="docutils literal notranslate"><span class="pre">chardet</span></code>.</p>
<p>The encoding of the response content is determined based solely on HTTP
headers, following RFC 2616 to the letter. If you can take advantage of
non-HTTP knowledge to make a better guess at the encoding, you should
set <code class="docutils literal notranslate"><span class="pre">r.encoding</span></code> appropriately before accessing this property.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.Response.url">
<span class="sig-name descname"><span class="pre">url</span></span><a class="headerlink" href="#requests.Response.url" title="Permalink to this definition">¶</a></dt>
<dd><p>Final URL location of Response.</p>
</dd></dl>

</dd></dl>

</section>
<section id="lower-lower-level-classes">
<h2>Lower-Lower-Level Classes<a class="headerlink" href="#lower-lower-level-classes" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="requests.PreparedRequest">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">PreparedRequest</span></span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest" title="Permalink to this definition">¶</a></dt>
<dd><p>The fully mutable <a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest"><code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code></a> object,
containing the exact bytes that will be sent to the server.</p>
<p>Instances are generated from a <a class="reference internal" href="#requests.Request" title="requests.Request"><code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code></a> object, and
should not be instantiated manually; doing so may produce undesirable
effects.</p>
<p>Usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">requests</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">req</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">Request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;https://httpbin.org/get&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">r</span> <span class="o">=</span> <span class="n">req</span><span class="o">.</span><span class="n">prepare</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">r</span>
<span class="go">&lt;PreparedRequest [GET]&gt;</span>

<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">Session</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
<span class="go">&lt;Response [200]&gt;</span>
</pre></div>
</div>
<dl class="py attribute">
<dt class="sig sig-object py" id="requests.PreparedRequest.body">
<span class="sig-name descname"><span class="pre">body</span></span><a class="headerlink" href="#requests.PreparedRequest.body" title="Permalink to this definition">¶</a></dt>
<dd><p>request body to send to the server.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.deregister_hook">
<span class="sig-name descname"><span class="pre">deregister_hook</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">event</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hook</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.PreparedRequest.deregister_hook" title="Permalink to this definition">¶</a></dt>
<dd><p>Deregister a previously registered hook.
Returns True if the hook existed, False if not.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.PreparedRequest.headers">
<span class="sig-name descname"><span class="pre">headers</span></span><a class="headerlink" href="#requests.PreparedRequest.headers" title="Permalink to this definition">¶</a></dt>
<dd><p>dictionary of HTTP headers.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.PreparedRequest.hooks">
<span class="sig-name descname"><span class="pre">hooks</span></span><a class="headerlink" href="#requests.PreparedRequest.hooks" title="Permalink to this definition">¶</a></dt>
<dd><p>dictionary of callback hooks, for internal usage.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.PreparedRequest.method">
<span class="sig-name descname"><span class="pre">method</span></span><a class="headerlink" href="#requests.PreparedRequest.method" title="Permalink to this definition">¶</a></dt>
<dd><p>HTTP verb to send to the server.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="requests.PreparedRequest.path_url">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">path_url</span></span><a class="headerlink" href="#requests.PreparedRequest.path_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Build the path URL to use.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare">
<span class="sig-name descname"><span class="pre">prepare</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">headers</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">files</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auth</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cookies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hooks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">json</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the entire request with the given parameters.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_auth">
<span class="sig-name descname"><span class="pre">prepare_auth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">auth</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_auth"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_auth" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the given HTTP auth data.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_body">
<span class="sig-name descname"><span class="pre">prepare_body</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">files</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">json</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_body"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_body" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the given HTTP body data.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_content_length">
<span class="sig-name descname"><span class="pre">prepare_content_length</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">body</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_content_length"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_content_length" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepare Content-Length header based on request method and body</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_cookies">
<span class="sig-name descname"><span class="pre">prepare_cookies</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cookies</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_cookies"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_cookies" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the given HTTP cookie data.</p>
<p>This function eventually generates a <code class="docutils literal notranslate"><span class="pre">Cookie</span></code> header from the
given cookies using cookielib. Due to cookielib’s design, the header
will not be regenerated if it already exists, meaning this function
can only be called once for the life of the
<a class="reference internal" href="#requests.PreparedRequest" title="requests.PreparedRequest"><code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code></a> object. Any subsequent calls
to <code class="docutils literal notranslate"><span class="pre">prepare_cookies</span></code> will have no actual effect, unless the “Cookie”
header is removed beforehand.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_headers">
<span class="sig-name descname"><span class="pre">prepare_headers</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">headers</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_headers"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_headers" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the given HTTP headers.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_hooks">
<span class="sig-name descname"><span class="pre">prepare_hooks</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hooks</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_hooks"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_hooks" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the given hooks.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_method">
<span class="sig-name descname"><span class="pre">prepare_method</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">method</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_method"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_method" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the given HTTP method.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.prepare_url">
<span class="sig-name descname"><span class="pre">prepare_url</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/models/#PreparedRequest.prepare_url"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.PreparedRequest.prepare_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepares the given HTTP URL.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.PreparedRequest.register_hook">
<span class="sig-name descname"><span class="pre">register_hook</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">event</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hook</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.PreparedRequest.register_hook" title="Permalink to this definition">¶</a></dt>
<dd><p>Properly register a hook.</p>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="requests.PreparedRequest.url">
<span class="sig-name descname"><span class="pre">url</span></span><a class="headerlink" href="#requests.PreparedRequest.url" title="Permalink to this definition">¶</a></dt>
<dd><p>HTTP URL to send the request to.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.adapters.BaseAdapter">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.adapters.</span></span><span class="sig-name descname"><span class="pre">BaseAdapter</span></span><a class="reference internal" href="../_modules/requests/adapters/#BaseAdapter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.BaseAdapter" title="Permalink to this definition">¶</a></dt>
<dd><p>The Base Transport Adapter</p>
<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.BaseAdapter.close">
<span class="sig-name descname"><span class="pre">close</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#BaseAdapter.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.BaseAdapter.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Cleans up adapter specific items.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.BaseAdapter.send">
<span class="sig-name descname"><span class="pre">send</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stream</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#BaseAdapter.send"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.BaseAdapter.send" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends PreparedRequest object. Returns Response object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>request</strong> – The <code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code> being sent.</p></li>
<li><p><strong>stream</strong> – (optional) Whether to stream the request content.</p></li>
<li><p><strong>timeout</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.11)"><em>float</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.11)"><em>tuple</em></a>) – (optional) How long to wait for the server to send
data before giving up, as a float, or a <a class="reference internal" href="../user/advanced/#timeouts"><span class="std std-ref">(connect timeout,
read timeout)</span></a> tuple.</p></li>
<li><p><strong>verify</strong> – (optional) Either a boolean, in which case it controls whether we verify
the server’s TLS certificate, or a string, in which case it must be a path
to a CA bundle to use</p></li>
<li><p><strong>cert</strong> – (optional) Any user-provided SSL certificate to be trusted.</p></li>
<li><p><strong>proxies</strong> – (optional) The proxies dictionary to apply to the request.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.adapters.</span></span><span class="sig-name descname"><span class="pre">HTTPAdapter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pool_connections</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">10</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pool_maxsize</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">10</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_retries</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pool_block</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter" title="Permalink to this definition">¶</a></dt>
<dd><p>The built-in HTTP Adapter for urllib3.</p>
<p>Provides a general-case interface for Requests sessions to contact HTTP and
HTTPS urls by implementing the Transport Adapter interface. This class will
usually be created by the <code class="xref py py-class docutils literal notranslate"><span class="pre">Session</span></code> class under the
covers.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pool_connections</strong> – The number of urllib3 connection pools to cache.</p></li>
<li><p><strong>pool_maxsize</strong> – The maximum number of connections to save in the pool.</p></li>
<li><p><strong>max_retries</strong> – The maximum number of retries each connection
should attempt. Note, this applies only to failed DNS lookups, socket
connections and connection timeouts, never to requests where data has
made it to the server. By default, Requests does not retry failed
connections. If you need granular control over the conditions under
which we retry a request, import urllib3’s <code class="docutils literal notranslate"><span class="pre">Retry</span></code> class and pass
that instead.</p></li>
<li><p><strong>pool_block</strong> – Whether the connection pool should block for connections.</p></li>
</ul>
</dd>
</dl>
<p>Usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">requests</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">Session</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">adapters</span><span class="o">.</span><span class="n">HTTPAdapter</span><span class="p">(</span><span class="n">max_retries</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">mount</span><span class="p">(</span><span class="s1">&#39;http://&#39;</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span>
</pre></div>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.add_headers">
<span class="sig-name descname"><span class="pre">add_headers</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.add_headers"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.add_headers" title="Permalink to this definition">¶</a></dt>
<dd><p>Add any headers needed by the connection. As of v2.0 this does
nothing by default, but is left for overriding by users that subclass
the <a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<p>This should not be called from user code, and is only exposed for use
when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>request</strong> – The <code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code> to add headers to.</p></li>
<li><p><strong>kwargs</strong> – The keyword arguments from the call to send().</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.build_response">
<span class="sig-name descname"><span class="pre">build_response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">req</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">resp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.build_response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.build_response" title="Permalink to this definition">¶</a></dt>
<dd><p>Builds a <a class="reference internal" href="#requests.Response" title="requests.Response"><code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code></a> object from a urllib3
response. This should not be called from user code, and is only exposed
for use when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>req</strong> – The <code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code> used to generate the response.</p></li>
<li><p><strong>resp</strong> – The urllib3 response object.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.cert_verify">
<span class="sig-name descname"><span class="pre">cert_verify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">conn</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.cert_verify"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.cert_verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify a SSL certificate. This method should not be called from user
code, and is only exposed for use when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>conn</strong> – The urllib3 connection object associated with the cert.</p></li>
<li><p><strong>url</strong> – The requested URL.</p></li>
<li><p><strong>verify</strong> – Either a boolean, in which case it controls whether we verify
the server’s TLS certificate, or a string, in which case it must be a path
to a CA bundle to use</p></li>
<li><p><strong>cert</strong> – The SSL certificate to verify.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.close">
<span class="sig-name descname"><span class="pre">close</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Disposes of any internal state.</p>
<p>Currently, this closes the PoolManager and any active ProxyManager,
which closes any pooled connections.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.get_connection">
<span class="sig-name descname"><span class="pre">get_connection</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.get_connection"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.get_connection" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a urllib3 connection for the given URL. This should not be
called from user code, and is only exposed for use when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – The URL to connect to.</p></li>
<li><p><strong>proxies</strong> – (optional) A Requests-style dictionary of proxies used on this request.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>urllib3.ConnectionPool</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.init_poolmanager">
<span class="sig-name descname"><span class="pre">init_poolmanager</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">connections</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maxsize</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">block</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">pool_kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.init_poolmanager"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.init_poolmanager" title="Permalink to this definition">¶</a></dt>
<dd><p>Initializes a urllib3 PoolManager.</p>
<p>This method should not be called from user code, and is only
exposed for use when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>connections</strong> – The number of urllib3 connection pools to cache.</p></li>
<li><p><strong>maxsize</strong> – The maximum number of connections to save in the pool.</p></li>
<li><p><strong>block</strong> – Block when no free connections are available.</p></li>
<li><p><strong>pool_kwargs</strong> – Extra keyword arguments used to initialize the Pool Manager.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.proxy_headers">
<span class="sig-name descname"><span class="pre">proxy_headers</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">proxy</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.proxy_headers"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.proxy_headers" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary of the headers to add to any request sent
through a proxy. This works with urllib3 magic to ensure that they are
correctly sent to the proxy, rather than in a tunnelled request if
CONNECT is being used.</p>
<p>This should not be called from user code, and is only exposed for use
when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>proxy</strong> – The url of the proxy being used for this request.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)">dict</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.proxy_manager_for">
<span class="sig-name descname"><span class="pre">proxy_manager_for</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">proxy</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">proxy_kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.proxy_manager_for"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.proxy_manager_for" title="Permalink to this definition">¶</a></dt>
<dd><p>Return urllib3 ProxyManager for the given proxy.</p>
<p>This method should not be called from user code, and is only
exposed for use when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>proxy</strong> – The proxy to return a urllib3 ProxyManager for.</p></li>
<li><p><strong>proxy_kwargs</strong> – Extra keyword arguments used to configure the Proxy Manager.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>ProxyManager</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://urllib3.readthedocs.io/en/latest/reference/urllib3.poolmanager.html#urllib3.ProxyManager" title="(in urllib3 v2.0.0a3)">urllib3.ProxyManager</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.request_url">
<span class="sig-name descname"><span class="pre">request_url</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.request_url"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.request_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Obtain the url to use when making the final request.</p>
<p>If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.</p>
<p>This should not be called from user code, and is only exposed for use
when subclassing the
<a class="reference internal" href="#requests.adapters.HTTPAdapter" title="requests.adapters.HTTPAdapter"><code class="xref py py-class docutils literal notranslate"><span class="pre">HTTPAdapter</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>request</strong> – The <code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code> being sent.</p></li>
<li><p><strong>proxies</strong> – A dictionary of schemes or schemes and hosts to proxy URLs.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)">str</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.adapters.HTTPAdapter.send">
<span class="sig-name descname"><span class="pre">send</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stream</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cert</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">proxies</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/adapters/#HTTPAdapter.send"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.adapters.HTTPAdapter.send" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends PreparedRequest object. Returns Response object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>request</strong> – The <code class="xref py py-class docutils literal notranslate"><span class="pre">PreparedRequest</span></code> being sent.</p></li>
<li><p><strong>stream</strong> – (optional) Whether to stream the request content.</p></li>
<li><p><strong>timeout</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.11)"><em>float</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.11)"><em>tuple</em></a><em> or </em><em>urllib3 Timeout object</em>) – (optional) How long to wait for the server to send
data before giving up, as a float, or a <a class="reference internal" href="../user/advanced/#timeouts"><span class="std std-ref">(connect timeout,
read timeout)</span></a> tuple.</p></li>
<li><p><strong>verify</strong> – (optional) Either a boolean, in which case it controls whether
we verify the server’s TLS certificate, or a string, in which case it
must be a path to a CA bundle to use</p></li>
<li><p><strong>cert</strong> – (optional) Any user-provided SSL certificate to be trusted.</p></li>
<li><p><strong>proxies</strong> – (optional) The proxies dictionary to apply to the request.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#requests.Response" title="requests.Response">requests.Response</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>
<section id="authentication">
<h2>Authentication<a class="headerlink" href="#authentication" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="requests.auth.AuthBase">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.auth.</span></span><span class="sig-name descname"><span class="pre">AuthBase</span></span><a class="reference internal" href="../_modules/requests/auth/#AuthBase"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.auth.AuthBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class that all auth implementations derive from</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.auth.HTTPBasicAuth">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.auth.</span></span><span class="sig-name descname"><span class="pre">HTTPBasicAuth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">username</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/auth/#HTTPBasicAuth"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.auth.HTTPBasicAuth" title="Permalink to this definition">¶</a></dt>
<dd><p>Attaches HTTP Basic Authentication to the given Request object.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.auth.HTTPProxyAuth">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.auth.</span></span><span class="sig-name descname"><span class="pre">HTTPProxyAuth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">username</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/auth/#HTTPProxyAuth"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.auth.HTTPProxyAuth" title="Permalink to this definition">¶</a></dt>
<dd><p>Attaches HTTP Proxy Authentication to a given Request object.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.auth.HTTPDigestAuth">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.auth.</span></span><span class="sig-name descname"><span class="pre">HTTPDigestAuth</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">username</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/auth/#HTTPDigestAuth"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.auth.HTTPDigestAuth" title="Permalink to this definition">¶</a></dt>
<dd><p>Attaches HTTP Digest Authentication to the given Request object.</p>
</dd></dl>

</section>
<section id="encodings">
<h2>Encodings<a class="headerlink" href="#encodings" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="requests.utils.get_encodings_from_content">
<span class="sig-prename descclassname"><span class="pre">requests.utils.</span></span><span class="sig-name descname"><span class="pre">get_encodings_from_content</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">content</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/utils/#get_encodings_from_content"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.utils.get_encodings_from_content" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns encodings from given content string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>content</strong> – bytestring to extract encodings from.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.utils.get_encoding_from_headers">
<span class="sig-prename descclassname"><span class="pre">requests.utils.</span></span><span class="sig-name descname"><span class="pre">get_encoding_from_headers</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">headers</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/utils/#get_encoding_from_headers"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.utils.get_encoding_from_headers" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns encodings from given HTTP Header Dict.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>headers</strong> – dictionary to extract encoding from.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)">str</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.utils.get_unicode_from_response">
<span class="sig-prename descclassname"><span class="pre">requests.utils.</span></span><span class="sig-name descname"><span class="pre">get_unicode_from_response</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">r</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/utils/#get_unicode_from_response"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.utils.get_unicode_from_response" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the requested content back in unicode.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>r</strong> – Response object to get unicode content from.</p>
</dd>
</dl>
<p>Tried:</p>
<ol class="arabic simple">
<li><p>charset from content-type</p></li>
<li><p>fall back and replace all unicode characters</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.11)">str</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="cookies">
<span id="api-cookies"></span><h2>Cookies<a class="headerlink" href="#cookies" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="requests.utils.dict_from_cookiejar">
<span class="sig-prename descclassname"><span class="pre">requests.utils.</span></span><span class="sig-name descname"><span class="pre">dict_from_cookiejar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cj</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/utils/#dict_from_cookiejar"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.utils.dict_from_cookiejar" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a key/value dictionary from a CookieJar.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cj</strong> – CookieJar object to extract cookies from.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)">dict</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.utils.add_dict_to_cookiejar">
<span class="sig-prename descclassname"><span class="pre">requests.utils.</span></span><span class="sig-name descname"><span class="pre">add_dict_to_cookiejar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cookie_dict</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/utils/#add_dict_to_cookiejar"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.utils.add_dict_to_cookiejar" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a CookieJar from a key/value dictionary.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cj</strong> – CookieJar to insert cookies into.</p></li>
<li><p><strong>cookie_dict</strong> – Dict of key/values to insert into CookieJar.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>CookieJar</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="requests.cookies.cookiejar_from_dict">
<span class="sig-prename descclassname"><span class="pre">requests.cookies.</span></span><span class="sig-name descname"><span class="pre">cookiejar_from_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cookie_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cookiejar</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">overwrite</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#cookiejar_from_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.cookiejar_from_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a CookieJar from a key/value dictionary.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cookie_dict</strong> – Dict of key/values to insert into CookieJar.</p></li>
<li><p><strong>cookiejar</strong> – (optional) A cookiejar to add the cookies to.</p></li>
<li><p><strong>overwrite</strong> – (optional) If False, will not replace cookies
already in the jar with new ones.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>CookieJar</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.cookies.</span></span><span class="sig-name descname"><span class="pre">RequestsCookieJar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">policy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar" title="Permalink to this definition">¶</a></dt>
<dd><p>Compatibility class; is a cookielib.CookieJar, but exposes a dict
interface.</p>
<p>This is the CookieJar we create by default for requests and sessions that
don’t specify one, since some clients may expect response.cookies and
session.cookies to support dict operations.</p>
<p>Requests does not use the dict interface internally; it’s just for
compatibility with external client code. All requests code should work
out of the box with externally provided instances of <code class="docutils literal notranslate"><span class="pre">CookieJar</span></code>, e.g.
<code class="docutils literal notranslate"><span class="pre">LWPCookieJar</span></code> and <code class="docutils literal notranslate"><span class="pre">FileCookieJar</span></code>.</p>
<p>Unlike a regular CookieJar, this class is pickleable.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>dictionary operations that are normally O(1) may be O(n).</p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.add_cookie_header">
<span class="sig-name descname"><span class="pre">add_cookie_header</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.add_cookie_header" title="Permalink to this definition">¶</a></dt>
<dd><p>Add correct Cookie: header to request (urllib.request.Request object).</p>
<p>The Cookie2 header is also added unless policy.hide_cookie2 is true.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.clear">
<span class="sig-name descname"><span class="pre">clear</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.clear" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear some cookies.</p>
<p>Invoking this method without arguments will clear all cookies.  If
given a single argument, only cookies belonging to that domain will be
removed.  If given two arguments, cookies belonging to the specified
path within that domain are removed.  If given three arguments, then
the cookie with the specified name, path and domain is removed.</p>
<p>Raises KeyError if no matching cookie exists.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.clear_expired_cookies">
<span class="sig-name descname"><span class="pre">clear_expired_cookies</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.clear_expired_cookies" title="Permalink to this definition">¶</a></dt>
<dd><p>Discard all expired cookies.</p>
<p>You probably don’t need to call this method: expired cookies are never
sent back to the server (provided you’re using DefaultCookiePolicy),
this method is called by CookieJar itself every so often, and the
.save() method won’t save expired cookies anyway (unless you ask
otherwise by passing a true ignore_expires argument).</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.clear_session_cookies">
<span class="sig-name descname"><span class="pre">clear_session_cookies</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.clear_session_cookies" title="Permalink to this definition">¶</a></dt>
<dd><p>Discard all session cookies.</p>
<p>Note that the .save() method won’t save session cookies anyway, unless
you ask otherwise by passing a true ignore_discard argument.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.copy">
<span class="sig-name descname"><span class="pre">copy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.copy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a copy of this RequestsCookieJar.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.extract_cookies">
<span class="sig-name descname"><span class="pre">extract_cookies</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">response</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.extract_cookies" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract cookies from response, where allowable given the request.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.get">
<span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like get() that also supports optional domain and path args in
order to resolve naming collisions from using one cookie jar over
multiple domains.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>operation is O(n), not O(1).</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.get_dict">
<span class="sig-name descname"><span class="pre">get_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.get_dict"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.get_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes as an argument an optional domain and path and returns a plain
old Python dict of name-value pairs of cookies that meet the
requirements.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.11)">dict</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.get_policy">
<span class="sig-name descname"><span class="pre">get_policy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.get_policy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.get_policy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the CookiePolicy instance used.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.items">
<span class="sig-name descname"><span class="pre">items</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.items"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.items" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like items() that returns a list of name-value tuples from the
jar. Allows client-code to call <code class="docutils literal notranslate"><span class="pre">dict(RequestsCookieJar)</span></code> and get a
vanilla python dict of key value pairs.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>keys() and values().</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.iteritems">
<span class="sig-name descname"><span class="pre">iteritems</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.iteritems"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.iteritems" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like iteritems() that returns an iterator of name-value tuples
from the jar.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>iterkeys() and itervalues().</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.iterkeys">
<span class="sig-name descname"><span class="pre">iterkeys</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.iterkeys"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.iterkeys" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like iterkeys() that returns an iterator of names of cookies
from the jar.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>itervalues() and iteritems().</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.itervalues">
<span class="sig-name descname"><span class="pre">itervalues</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.itervalues"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.itervalues" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like itervalues() that returns an iterator of values of cookies
from the jar.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>iterkeys() and iteritems().</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.keys">
<span class="sig-name descname"><span class="pre">keys</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.keys"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.keys" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like keys() that returns a list of names of cookies from the
jar.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>values() and items().</p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.list_domains">
<span class="sig-name descname"><span class="pre">list_domains</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.list_domains"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.list_domains" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility method to list all the domains in the jar.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.list_paths">
<span class="sig-name descname"><span class="pre">list_paths</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.list_paths"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.list_paths" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility method to list all the paths in the jar.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.make_cookies">
<span class="sig-name descname"><span class="pre">make_cookies</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">response</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.make_cookies" title="Permalink to this definition">¶</a></dt>
<dd><p>Return sequence of Cookie objects extracted from response object.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.multiple_domains">
<span class="sig-name descname"><span class="pre">multiple_domains</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.multiple_domains"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.multiple_domains" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if there are multiple domains in the jar.
Returns False otherwise.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.11)">bool</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.pop">
<span class="sig-name descname"><span class="pre">pop</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">k</span></em><span class="optional">[</span>, <em class="sig-param"><span class="pre">d</span></em><span class="optional">]</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">v,</span> <span class="pre">remove</span> <span class="pre">specified</span> <span class="pre">key</span> <span class="pre">and</span> <span class="pre">return</span> <span class="pre">the</span> <span class="pre">corresponding</span> <span class="pre">value.</span></span></span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>If key is not found, d is returned if given, otherwise KeyError is raised.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.popitem">
<span class="sig-name descname"><span class="pre">popitem</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">(k,</span> <span class="pre">v),</span> <span class="pre">remove</span> <span class="pre">and</span> <span class="pre">return</span> <span class="pre">some</span> <span class="pre">(key,</span> <span class="pre">value)</span> <span class="pre">pair</span></span></span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.popitem" title="Permalink to this definition">¶</a></dt>
<dd><p>as a 2-tuple; but raise KeyError if D is empty.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.set">
<span class="sig-name descname"><span class="pre">set</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.set"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.set" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like set() that also supports optional domain and path args in
order to resolve naming collisions from using one cookie jar over
multiple domains.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.set_cookie">
<span class="sig-name descname"><span class="pre">set_cookie</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cookie</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.set_cookie"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.set_cookie" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a cookie, without checking whether or not it should be set.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.set_cookie_if_ok">
<span class="sig-name descname"><span class="pre">set_cookie_if_ok</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cookie</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.set_cookie_if_ok" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a cookie if policy says it’s OK to do so.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.setdefault">
<span class="sig-name descname"><span class="pre">setdefault</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">k</span></em><span class="optional">[</span>, <em class="sig-param"><span class="pre">d</span></em><span class="optional">]</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">D.get(k,d),</span> <span class="pre">also</span> <span class="pre">set</span> <span class="pre">D[k]=d</span> <span class="pre">if</span> <span class="pre">k</span> <span class="pre">not</span> <span class="pre">in</span> <span class="pre">D</span></span></span><a class="headerlink" href="#requests.cookies.RequestsCookieJar.setdefault" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.update">
<span class="sig-name descname"><span class="pre">update</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.update"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.update" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates this jar with cookies from another CookieJar or dict-like</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.RequestsCookieJar.values">
<span class="sig-name descname"><span class="pre">values</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/requests/cookies/#RequestsCookieJar.values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.RequestsCookieJar.values" title="Permalink to this definition">¶</a></dt>
<dd><p>Dict-like values() that returns a list of values of cookies from the
jar.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>keys() and items().</p>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="requests.cookies.CookieConflictError">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">requests.cookies.</span></span><span class="sig-name descname"><span class="pre">CookieConflictError</span></span><a class="reference internal" href="../_modules/requests/cookies/#CookieConflictError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#requests.cookies.CookieConflictError" title="Permalink to this definition">¶</a></dt>
<dd><p>There are two cookies that meet the criteria specified in the cookie jar.
Use .get and .set and include domain and path args in order to be more specific.</p>
<dl class="py method">
<dt class="sig sig-object py" id="requests.cookies.CookieConflictError.with_traceback">
<span class="sig-name descname"><span class="pre">with_traceback</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#requests.cookies.CookieConflictError.with_traceback" title="Permalink to this definition">¶</a></dt>
<dd><p>Exception.with_traceback(tb) –
set self.__traceback__ to tb and return self.</p>
</dd></dl>

</dd></dl>

</section>
<section id="status-code-lookup">
<h2>Status Code Lookup<a class="headerlink" href="#status-code-lookup" title="Permalink to this headline">¶</a></h2>
<dl class="py attribute">
<dt class="sig sig-object py" id="requests.codes">
<span class="sig-prename descclassname"><span class="pre">requests.</span></span><span class="sig-name descname"><span class="pre">codes</span></span><a class="headerlink" href="#requests.codes" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of &lt;lookup ‘status_codes’&gt;</p>
</dd></dl>

<span class="target" id="module-requests.status_codes"></span><p>The <code class="docutils literal notranslate"><span class="pre">codes</span></code> object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">requests</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">requests</span><span class="o">.</span><span class="n">codes</span><span class="p">[</span><span class="s1">&#39;temporary_redirect&#39;</span><span class="p">]</span>
<span class="go">307</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">requests</span><span class="o">.</span><span class="n">codes</span><span class="o">.</span><span class="n">teapot</span>
<span class="go">418</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">requests</span><span class="o">.</span><span class="n">codes</span><span class="p">[</span><span class="s1">&#39;\o/&#39;</span><span class="p">]</span>
<span class="go">200</span>
</pre></div>
</div>
<p>Some codes have multiple names, and both upper- and lower-case versions of
the names are allowed. For example, <code class="docutils literal notranslate"><span class="pre">codes.ok</span></code>, <code class="docutils literal notranslate"><span class="pre">codes.OK</span></code>, and
<code class="docutils literal notranslate"><span class="pre">codes.okay</span></code> all correspond to the HTTP status code 200.</p>
<ul class="simple">
<li><p>100: <code class="docutils literal notranslate"><span class="pre">continue</span></code></p></li>
<li><p>101: <code class="docutils literal notranslate"><span class="pre">switching_protocols</span></code></p></li>
<li><p>102: <code class="docutils literal notranslate"><span class="pre">processing</span></code></p></li>
<li><p>103: <code class="docutils literal notranslate"><span class="pre">checkpoint</span></code></p></li>
<li><p>122: <code class="docutils literal notranslate"><span class="pre">uri_too_long</span></code>, <code class="docutils literal notranslate"><span class="pre">request_uri_too_long</span></code></p></li>
<li><p>200: <code class="docutils literal notranslate"><span class="pre">ok</span></code>, <code class="docutils literal notranslate"><span class="pre">okay</span></code>, <code class="docutils literal notranslate"><span class="pre">all_ok</span></code>, <code class="docutils literal notranslate"><span class="pre">all_okay</span></code>, <code class="docutils literal notranslate"><span class="pre">all_good</span></code>, <code class="docutils literal notranslate"><span class="pre">\o/</span></code>, <code class="docutils literal notranslate"><span class="pre">✓</span></code></p></li>
<li><p>201: <code class="docutils literal notranslate"><span class="pre">created</span></code></p></li>
<li><p>202: <code class="docutils literal notranslate"><span class="pre">accepted</span></code></p></li>
<li><p>203: <code class="docutils literal notranslate"><span class="pre">non_authoritative_info</span></code>, <code class="docutils literal notranslate"><span class="pre">non_authoritative_information</span></code></p></li>
<li><p>204: <code class="docutils literal notranslate"><span class="pre">no_content</span></code></p></li>
<li><p>205: <code class="docutils literal notranslate"><span class="pre">reset_content</span></code>, <code class="docutils literal notranslate"><span class="pre">reset</span></code></p></li>
<li><p>206: <code class="docutils literal notranslate"><span class="pre">partial_content</span></code>, <code class="docutils literal notranslate"><span class="pre">partial</span></code></p></li>
<li><p>207: <code class="docutils literal notranslate"><span class="pre">multi_status</span></code>, <code class="docutils literal notranslate"><span class="pre">multiple_status</span></code>, <code class="docutils literal notranslate"><span class="pre">multi_stati</span></code>, <code class="docutils literal notranslate"><span class="pre">multiple_stati</span></code></p></li>
<li><p>208: <code class="docutils literal notranslate"><span class="pre">already_reported</span></code></p></li>
<li><p>226: <code class="docutils literal notranslate"><span class="pre">im_used</span></code></p></li>
<li><p>300: <code class="docutils literal notranslate"><span class="pre">multiple_choices</span></code></p></li>
<li><p>301: <code class="docutils literal notranslate"><span class="pre">moved_permanently</span></code>, <code class="docutils literal notranslate"><span class="pre">moved</span></code>, <code class="docutils literal notranslate"><span class="pre">\o-</span></code></p></li>
<li><p>302: <code class="docutils literal notranslate"><span class="pre">found</span></code></p></li>
<li><p>303: <code class="docutils literal notranslate"><span class="pre">see_other</span></code>, <code class="docutils literal notranslate"><span class="pre">other</span></code></p></li>
<li><p>304: <code class="docutils literal notranslate"><span class="pre">not_modified</span></code></p></li>
<li><p>305: <code class="docutils literal notranslate"><span class="pre">use_proxy</span></code></p></li>
<li><p>306: <code class="docutils literal notranslate"><span class="pre">switch_proxy</span></code></p></li>
<li><p>307: <code class="docutils literal notranslate"><span class="pre">temporary_redirect</span></code>, <code class="docutils literal notranslate"><span class="pre">temporary_moved</span></code>, <code class="docutils literal notranslate"><span class="pre">temporary</span></code></p></li>
<li><p>308: <code class="docutils literal notranslate"><span class="pre">permanent_redirect</span></code>, <code class="docutils literal notranslate"><span class="pre">resume_incomplete</span></code>, <code class="docutils literal notranslate"><span class="pre">resume</span></code></p></li>
<li><p>400: <code class="docutils literal notranslate"><span class="pre">bad_request</span></code>, <code class="docutils literal notranslate"><span class="pre">bad</span></code></p></li>
<li><p>401: <code class="docutils literal notranslate"><span class="pre">unauthorized</span></code></p></li>
<li><p>402: <code class="docutils literal notranslate"><span class="pre">payment_required</span></code>, <code class="docutils literal notranslate"><span class="pre">payment</span></code></p></li>
<li><p>403: <code class="docutils literal notranslate"><span class="pre">forbidden</span></code></p></li>
<li><p>404: <code class="docutils literal notranslate"><span class="pre">not_found</span></code>, <code class="docutils literal notranslate"><span class="pre">-o-</span></code></p></li>
<li><p>405: <code class="docutils literal notranslate"><span class="pre">method_not_allowed</span></code>, <code class="docutils literal notranslate"><span class="pre">not_allowed</span></code></p></li>
<li><p>406: <code class="docutils literal notranslate"><span class="pre">not_acceptable</span></code></p></li>
<li><p>407: <code class="docutils literal notranslate"><span class="pre">proxy_authentication_required</span></code>, <code class="docutils literal notranslate"><span class="pre">proxy_auth</span></code>, <code class="docutils literal notranslate"><span class="pre">proxy_authentication</span></code></p></li>
<li><p>408: <code class="docutils literal notranslate"><span class="pre">request_timeout</span></code>, <code class="docutils literal notranslate"><span class="pre">timeout</span></code></p></li>
<li><p>409: <code class="docutils literal notranslate"><span class="pre">conflict</span></code></p></li>
<li><p>410: <code class="docutils literal notranslate"><span class="pre">gone</span></code></p></li>
<li><p>411: <code class="docutils literal notranslate"><span class="pre">length_required</span></code></p></li>
<li><p>412: <code class="docutils literal notranslate"><span class="pre">precondition_failed</span></code>, <code class="docutils literal notranslate"><span class="pre">precondition</span></code></p></li>
<li><p>413: <code class="docutils literal notranslate"><span class="pre">request_entity_too_large</span></code></p></li>
<li><p>414: <code class="docutils literal notranslate"><span class="pre">request_uri_too_large</span></code></p></li>
<li><p>415: <code class="docutils literal notranslate"><span class="pre">unsupported_media_type</span></code>, <code class="docutils literal notranslate"><span class="pre">unsupported_media</span></code>, <code class="docutils literal notranslate"><span class="pre">media_type</span></code></p></li>
<li><p>416: <code class="docutils literal notranslate"><span class="pre">requested_range_not_satisfiable</span></code>, <code class="docutils literal notranslate"><span class="pre">requested_range</span></code>, <code class="docutils literal notranslate"><span class="pre">range_not_satisfiable</span></code></p></li>
<li><p>417: <code class="docutils literal notranslate"><span class="pre">expectation_failed</span></code></p></li>
<li><p>418: <code class="docutils literal notranslate"><span class="pre">im_a_teapot</span></code>, <code class="docutils literal notranslate"><span class="pre">teapot</span></code>, <code class="docutils literal notranslate"><span class="pre">i_am_a_teapot</span></code></p></li>
<li><p>421: <code class="docutils literal notranslate"><span class="pre">misdirected_request</span></code></p></li>
<li><p>422: <code class="docutils literal notranslate"><span class="pre">unprocessable_entity</span></code>, <code class="docutils literal notranslate"><span class="pre">unprocessable</span></code></p></li>
<li><p>423: <code class="docutils literal notranslate"><span class="pre">locked</span></code></p></li>
<li><p>424: <code class="docutils literal notranslate"><span class="pre">failed_dependency</span></code>, <code class="docutils literal notranslate"><span class="pre">dependency</span></code></p></li>
<li><p>425: <code class="docutils literal notranslate"><span class="pre">unordered_collection</span></code>, <code class="docutils literal notranslate"><span class="pre">unordered</span></code></p></li>
<li><p>426: <code class="docutils literal notranslate"><span class="pre">upgrade_required</span></code>, <code class="docutils literal notranslate"><span class="pre">upgrade</span></code></p></li>
<li><p>428: <code class="docutils literal notranslate"><span class="pre">precondition_required</span></code>, <code class="docutils literal notranslate"><span class="pre">precondition</span></code></p></li>
<li><p>429: <code class="docutils literal notranslate"><span class="pre">too_many_requests</span></code>, <code class="docutils literal notranslate"><span class="pre">too_many</span></code></p></li>
<li><p>431: <code class="docutils literal notranslate"><span class="pre">header_fields_too_large</span></code>, <code class="docutils literal notranslate"><span class="pre">fields_too_large</span></code></p></li>
<li><p>444: <code class="docutils literal notranslate"><span class="pre">no_response</span></code>, <code class="docutils literal notranslate"><span class="pre">none</span></code></p></li>
<li><p>449: <code class="docutils literal notranslate"><span class="pre">retry_with</span></code>, <code class="docutils literal notranslate"><span class="pre">retry</span></code></p></li>
<li><p>450: <code class="docutils literal notranslate"><span class="pre">blocked_by_windows_parental_controls</span></code>, <code class="docutils literal notranslate"><span class="pre">parental_controls</span></code></p></li>
<li><p>451: <code class="docutils literal notranslate"><span class="pre">unavailable_for_legal_reasons</span></code>, <code class="docutils literal notranslate"><span class="pre">legal_reasons</span></code></p></li>
<li><p>499: <code class="docutils literal notranslate"><span class="pre">client_closed_request</span></code></p></li>
<li><p>500: <code class="docutils literal notranslate"><span class="pre">internal_server_error</span></code>, <code class="docutils literal notranslate"><span class="pre">server_error</span></code>, <code class="docutils literal notranslate"><span class="pre">/o\</span></code>, <code class="docutils literal notranslate"><span class="pre">✗</span></code></p></li>
<li><p>501: <code class="docutils literal notranslate"><span class="pre">not_implemented</span></code></p></li>
<li><p>502: <code class="docutils literal notranslate"><span class="pre">bad_gateway</span></code></p></li>
<li><p>503: <code class="docutils literal notranslate"><span class="pre">service_unavailable</span></code>, <code class="docutils literal notranslate"><span class="pre">unavailable</span></code></p></li>
<li><p>504: <code class="docutils literal notranslate"><span class="pre">gateway_timeout</span></code></p></li>
<li><p>505: <code class="docutils literal notranslate"><span class="pre">http_version_not_supported</span></code>, <code class="docutils literal notranslate"><span class="pre">http_version</span></code></p></li>
<li><p>506: <code class="docutils literal notranslate"><span class="pre">variant_also_negotiates</span></code></p></li>
<li><p>507: <code class="docutils literal notranslate"><span class="pre">insufficient_storage</span></code></p></li>
<li><p>509: <code class="docutils literal notranslate"><span class="pre">bandwidth_limit_exceeded</span></code>, <code class="docutils literal notranslate"><span class="pre">bandwidth</span></code></p></li>
<li><p>510: <code class="docutils literal notranslate"><span class="pre">not_extended</span></code></p></li>
<li><p>511: <code class="docutils literal notranslate"><span class="pre">network_authentication_required</span></code>, <code class="docutils literal notranslate"><span class="pre">network_auth</span></code>, <code class="docutils literal notranslate"><span class="pre">network_authentication</span></code></p></li>
</ul>
</section>
<section id="migrating-to-1-x">
<h2>Migrating to 1.x<a class="headerlink" href="#migrating-to-1-x" title="Permalink to this headline">¶</a></h2>
<p>This section details the main differences between 0.x and 1.x and is meant
to ease the pain of upgrading.</p>
<section id="api-changes">
<h3>API Changes<a class="headerlink" href="#api-changes" title="Permalink to this headline">¶</a></h3>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">Response.json</span></code> is now a callable and not a property of a response.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">requests</span>
<span class="n">r</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;https://api.github.com/events&#39;</span><span class="p">)</span>
<span class="n">r</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>   <span class="c1"># This *call* raises an exception if JSON decoding fails</span>
</pre></div>
</div>
</li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">Session</span></code> API has changed. Sessions objects no longer take parameters.
<code class="docutils literal notranslate"><span class="pre">Session</span></code> is also now capitalized, but it can still be
instantiated with a lowercase <code class="docutils literal notranslate"><span class="pre">session</span></code> for backwards compatibility.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">s</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">Session</span><span class="p">()</span>    <span class="c1"># formerly, session took parameters</span>
<span class="n">s</span><span class="o">.</span><span class="n">auth</span> <span class="o">=</span> <span class="n">auth</span>
<span class="n">s</span><span class="o">.</span><span class="n">headers</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">headers</span><span class="p">)</span>
<span class="n">r</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;https://httpbin.org/headers&#39;</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p>All request hooks have been removed except ‘response’.</p></li>
<li><p>Authentication helpers have been broken out into separate modules. See
<a class="reference external" href="https://github.com/requests/requests-oauthlib">requests-oauthlib</a> and <a class="reference external" href="https://github.com/requests/requests-kerberos">requests-kerberos</a>.</p></li>
</ul>
<ul>
<li><p>The parameter for streaming requests was changed from <code class="docutils literal notranslate"><span class="pre">prefetch</span></code> to
<code class="docutils literal notranslate"><span class="pre">stream</span></code> and the logic was inverted. In addition, <code class="docutils literal notranslate"><span class="pre">stream</span></code> is now
required for raw response reading.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># in 0.x, passing prefetch=False would accomplish the same thing</span>
<span class="n">r</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;https://api.github.com/events&#39;</span><span class="p">,</span> <span class="n">stream</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">for</span> <span class="n">chunk</span> <span class="ow">in</span> <span class="n">r</span><span class="o">.</span><span class="n">iter_content</span><span class="p">(</span><span class="mi">8192</span><span class="p">):</span>
    <span class="o">...</span>
</pre></div>
</div>
</li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">config</span></code> parameter to the requests method has been removed. Some of
these options are now configured on a <code class="docutils literal notranslate"><span class="pre">Session</span></code> such as keep-alive and
maximum number of redirects. The verbosity option should be handled by
configuring logging.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">requests</span>
<span class="kn">import</span> <span class="nn">logging</span>

<span class="c1"># Enabling debugging at http.client level (requests-&gt;urllib3-&gt;http.client)</span>
<span class="c1"># you will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.</span>
<span class="c1"># the only thing missing will be the response.body which is not logged.</span>
<span class="k">try</span><span class="p">:</span> <span class="c1"># for Python 3</span>
    <span class="kn">from</span> <span class="nn">http.client</span> <span class="kn">import</span> <span class="n">HTTPConnection</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
    <span class="kn">from</span> <span class="nn">httplib</span> <span class="kn">import</span> <span class="n">HTTPConnection</span>
<span class="n">HTTPConnection</span><span class="o">.</span><span class="n">debuglevel</span> <span class="o">=</span> <span class="mi">1</span>

<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">()</span> <span class="c1"># you need to initialize logging, otherwise you will not see anything from requests</span>
<span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">)</span>
<span class="n">requests_log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">&quot;urllib3&quot;</span><span class="p">)</span>
<span class="n">requests_log</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">)</span>
<span class="n">requests_log</span><span class="o">.</span><span class="n">propagate</span> <span class="o">=</span> <span class="kc">True</span>

<span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;https://httpbin.org/headers&#39;</span><span class="p">)</span>
</pre></div>
</div>
</li>
</ul>
</section>
<section id="licensing">
<h3>Licensing<a class="headerlink" href="#licensing" title="Permalink to this headline">¶</a></h3>
<p>One key difference that has nothing to do with the API is a change in the
license from the <a class="reference external" href="https://opensource.org/licenses/ISC">ISC</a> license to the <a class="reference external" href="https://opensource.org/licenses/Apache-2.0">Apache 2.0</a> license. The Apache 2.0
license ensures that contributions to Requests are also covered by the Apache
2.0 license.</p>
</section>
</section>
<section id="migrating-to-2-x">
<h2>Migrating to 2.x<a class="headerlink" href="#migrating-to-2-x" title="Permalink to this headline">¶</a></h2>
<p>Compared with the 1.0 release, there were relatively few backwards
incompatible changes, but there are still a few issues to be aware of with
this major release.</p>
<p>For more details on the changes in this release including new APIs, links
to the relevant GitHub issues and some of the bug fixes, read Cory’s <a class="reference external" href="https://lukasa.co.uk/2013/09/Requests_20/">blog</a>
on the subject.</p>
<section id="id1">
<h3>API Changes<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<ul>
<li><p>There were a couple changes to how Requests handles exceptions.
<code class="docutils literal notranslate"><span class="pre">RequestException</span></code> is now a subclass of <code class="docutils literal notranslate"><span class="pre">IOError</span></code> rather than
<code class="docutils literal notranslate"><span class="pre">RuntimeError</span></code> as that more accurately categorizes the type of error.
In addition, an invalid URL escape sequence now raises a subclass of
<code class="docutils literal notranslate"><span class="pre">RequestException</span></code> rather than a <code class="docutils literal notranslate"><span class="pre">ValueError</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;http://%zz/&#39;</span><span class="p">)</span>   <span class="c1"># raises requests.exceptions.InvalidURL</span>
</pre></div>
</div>
<p>Lastly, <code class="docutils literal notranslate"><span class="pre">httplib.IncompleteRead</span></code> exceptions caused by incorrect chunked
encoding will now raise a Requests <code class="docutils literal notranslate"><span class="pre">ChunkedEncodingError</span></code> instead.</p>
</li>
<li><p>The proxy API has changed slightly. The scheme for a proxy URL is now
required.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">proxies</span> <span class="o">=</span> <span class="p">{</span>
  <span class="s2">&quot;http&quot;</span><span class="p">:</span> <span class="s2">&quot;10.10.1.10:3128&quot;</span><span class="p">,</span>    <span class="c1"># use http://10.10.1.10:3128 instead</span>
<span class="p">}</span>

<span class="c1"># In requests 1.x, this was legal, in requests 2.x,</span>
<span class="c1">#  this raises requests.exceptions.MissingSchema</span>
<span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;http://example.org&quot;</span><span class="p">,</span> <span class="n">proxies</span><span class="o">=</span><span class="n">proxies</span><span class="p">)</span>
</pre></div>
</div>
</li>
</ul>
</section>
<section id="behavioural-changes">
<h3>Behavioural Changes<a class="headerlink" href="#behavioural-changes" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><p>Keys in the <code class="docutils literal notranslate"><span class="pre">headers</span></code> dictionary are now native strings on all Python
versions, i.e. bytestrings on Python 2 and unicode on Python 3. If the
keys are not native strings (unicode on Python 2 or bytestrings on Python 3)
they will be converted to the native string type assuming UTF-8 encoding.</p></li>
<li><p>Values in the <code class="docutils literal notranslate"><span class="pre">headers</span></code> dictionary should always be strings. This has
been the project’s position since before 1.0 but a recent change
(since version 2.11.0) enforces this more strictly. It’s advised to avoid
passing header values as unicode when possible.</p></li>
</ul>
</section>
</section>
</section>


          </div>

        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper"><p>
  <iframe src="https://ghbtns.com/github-btn.html?user=psf&repo=requests&type=watch&count=true&size=large"
    allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>

<p>
  Requests is an elegant and simple HTTP library for Python, built for
  human beings. You are currently looking at the documentation of the
  development release.
</p>

<h3>Useful Links</h3>
<ul>
  <li><a href="https://requests.readthedocs.io/en/latest/user/quickstart/">Quickstart</a></li>
  <li><a href="https://requests.readthedocs.io/en/latest/user/advanced/">Advanced Usage</a></li>
  <li><a href="https://requests.readthedocs.io/en/latest/api/">API Reference</a></li>
  <li><a href="https://requests.readthedocs.io/en/latest/community/updates/#release-history">Release History</a></li>
  <li><a href="https://requests.readthedocs.io/en/latest/dev/contributing/">Contributors Guide</a></li>

  <p></p>

  <li><a href="https://requests.readthedocs.io/en/latest/community/recommended/">Recommended Packages and Extensions</a></li>

  <p></p>

  <li><a href="https://github.com/psf/requests">Requests @ GitHub</a></li>
  <li><a href="https://pypi.org/project/requests/">Requests @ PyPI</a></li>
  <li><a href="https://github.com/psf/requests/issues">Issue Tracker</a></li>
</ul>

  <h3><a href="../">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Developer Interface</a><ul>
<li><a class="reference internal" href="#main-interface">Main Interface</a></li>
<li><a class="reference internal" href="#exceptions">Exceptions</a></li>
<li><a class="reference internal" href="#request-sessions">Request Sessions</a></li>
<li><a class="reference internal" href="#lower-level-classes">Lower-Level Classes</a></li>
<li><a class="reference internal" href="#lower-lower-level-classes">Lower-Lower-Level Classes</a></li>
<li><a class="reference internal" href="#authentication">Authentication</a></li>
<li><a class="reference internal" href="#encodings">Encodings</a></li>
<li><a class="reference internal" href="#cookies">Cookies</a></li>
<li><a class="reference internal" href="#status-code-lookup">Status Code Lookup</a></li>
<li><a class="reference internal" href="#migrating-to-1-x">Migrating to 1.x</a><ul>
<li><a class="reference internal" href="#api-changes">API Changes</a></li>
<li><a class="reference internal" href="#licensing">Licensing</a></li>
</ul>
</li>
<li><a class="reference internal" href="#migrating-to-2-x">Migrating to 2.x</a><ul>
<li><a class="reference internal" href="#id1">API Changes</a></li>
<li><a class="reference internal" href="#behavioural-changes">Behavioural Changes</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="../">Documentation overview</a><ul>
      <li>Previous: <a href="../community/updates/" title="previous chapter">Community Updates</a></li>
      <li>Next: <a href="../dev/contributing/" title="next chapter">Contributor’s Guide</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search/" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script><!-- Alabaster (krTheme++) Hacks -->

<!-- CSS Adjustments (I'm very picky.) -->
<style type="text/css">

  /* Rezzy requires precise alignment. */
  img.logo {margin-left: -20px!important;}

  /* "Quick Search" should be capitalized. */
  div#searchbox h3 {text-transform: capitalize;}

  /* Make the document a little wider, less code is cut-off. */
  div.document {width: 1008px;}

  /* Much-improved spacing around code blocks. */
  div.highlight pre {padding: 11px 14px;}

  /* Remain Responsive! */
  @media screen and (max-width: 1008px) {
    div.sphinxsidebar {display: none;}
    div.document {width: 100%!important;}

    /* Have code blocks escape the document right-margin. */
    div.highlight pre {margin-right: -30px;}
  }
</style>

<!-- Native CPC by BuySellAds -->

<script type="text/javascript" src="//m.servedby-buysellads.com/monetization.js"></script>

<div id="native-ribbon">
</div>

<script>
_bsa.init('custom', 'CK7D62JU', 'placement:pythonrequestsorg',
    {
      target: '#native-ribbon',
      template: `
<div class="native-sponsor">Sponsored by ##company## — Learn More</div>
  <a href="##link##" class="native-flex">
    <style>
    #native-ribbon #_custom_ {
      background: linear-gradient(-30deg, ##backgroundColor##E5, ##backgroundColor##E5 45%, ##backgroundColor## 45%) #fff;
    }

    .native-details,
    .native-sponsor,
    .native-bsa {
      color: ##textColor## !important;
    }

    .native-details:hover {
      color: ##textColorHover## !important;
    }

    .native-cta {
      color: ##ctaTextColor##;
      background-color: ##ctaBackgroundColor##;
    }

    .native-cta:hover {
      color: ##ctaTextColorHover##;
      background-color: ##ctaBackgroundColorHover##;
    }
    </style>
    <div class="native-main">
      <img class="native-img" src="##logo##">
      <div class="native-details">
        <span class="native-company">##title##</span>
        <span class="native-desc">##description##</span>
      </div>
    </div>
    <span class="native-cta">##callToAction##</span>
  </a>
</div>
`
    }
  );
</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;MMXVIX. A <a href="https://kenreitz.org/projects">Kenneth Reitz</a> Project.

    </div>


    <a href="https://github.com/requests/requests" class="github">
        <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"  class="github"/>
    </a>



  </body>
</html>
